{% extends "base2.html" %}
{% load staticfiles %}

  {% block private_css %}
    <link href="{% static 'css/select.css' %}" rel="stylesheet">
  {% endblock %}
  {% block content %}
    <!-- contain -->
    <div id="wapper"> 
        <div id="welcomePane">
          <div id="userImg" style="background-image:url({% static 'img/userDefault.png' %})"></div>
          <div id="userInfo"> 
       	    <br>
       	    <h3>{{ username }}</h3>
            <br>
       	    <h4>欢迎</h4>
       	    <br>
             <div style="display:n1one">{{user}}</div>
             <div style="display:n1one">{{chat}}</div>
          </div>

          <!--form id="enter" action="/Accounts/chat/" method="GET">
          <button id="enter" class="btn btn-danger center" >开始聊天</button>
          </form-->
          <button id="enter" class="btn btn-danger center" >开始聊天</button>
          
        </div>
    </div> <!-- wapper -->
  {% endblock %}
  
    {% block other_script %}
    <!--script src="{% static 'js/clearCookie.js' %}"></script-->
    <script type="text/javascript">
      function callback(data){
        //alert(data);
        document.body.innerHTML = "";
        document.write(data);
      };
      
      $("#enter").click(function(){
          $.ajax({
               type:'GET',
               url:'/Accounts/chat/',
               dataType:'html',
               success: callback,//(data),
               error:function(data)
               {
                  alert('error'); 
               }
             });
      });
     /* 
      $(document).ready(function callback(data){
          $.ajax({
              type: 'GET',
              url: '/Accounts/chat/'
              dataType:'html'
              success:function(){
                alert(data);
                callback;
              }
              error:function () {
                alert("error");
                callback;
              }
          })
      });
*/
    </script>
    {% endblock %}
    